b$.module("gadgets.config",function(){this.proxyUrl="/proxy";this.register=function(){}});b$.module("gadgets.json",function(){var b=JSON.stringify;var a=function(c){sTtext=c.replace(/\\x(..)/g,"\\u00$1");try{c=JSON.parse(c)}catch(d){d.message+=". Source: "+c;throw d}return c};this.stringify=b;this.parse=a});b$.module("gadgets.io",function(){var b=b$.Class;var d=gadgets.config;var l=gadgets.json;var g={};g.METHOD="method";g.CONTENT_TYPE="type";g.POST_DATA="data";g.HEADERS="headers";g.AUTHORIZATION="authorization";g.NUM_ENTRIES="NUM_ENTRIES";g.GET_SUMMARIES="GET_SUMMARIES";g.TIMEOUT="timeout";var f={};f.GET="GET";f.POST="POST";f.PUT="PUT";f.DELETE="DELETE";f.HEAD="HEAD";var e={};e.TEXT="text";e.DOM="xml";e.JSON="json";e.FEED="feed";var j={};j.NONE="NONE";j.SIGNED="SIGNED";j.OAUTH="OAUTH";var k={};k.REFRESH_INTERVAL="refresh";k.BACKBASE_PTC_PIPE="pipe";function c(m){var n=[],p="";for(var o in m){if(m.hasOwnProperty(o)){p=m[o];if(typeof p=="object"&&p.length){for(var q=0;q1){this.headers[n.shift()]=n.join(": ")}}if((q>=200&&q<300)||q==304||q==1223){switch(p){case e.DOM:this.data=new DOMParser().parseFromString(o,"application/xml");break;case e.JSON:try{this.data=l.parse(o)}catch(t){this.errors.push(t.message||t)}break;case e.FEED:this.errors.push("Not implemented");break;case e.TEXT:default:this.data=o;break}}else{if(q==0){this.errors.push("No connection to server")}else{this.errors.push("HTTP error:"+q);if(m){this.errors.push(m)}}}},{getHeader:function(n){n=String(n).toLowerCase();for(var m in this.headers){if(this.headers.hasOwnProperty(m)&&m.toLowerCase()==n){return this.headers[m]}}return null}});function i(m,s,o){o=o||{};var u=o[g.HEADERS]||{};var n=o[g.POST_DATA]||null;var r=Number(o[g.TIMEOUT])||30000;var t=b$.require("b$.utils.xsrf");if(o[g.METHOD]===f.POST&&!u["Content-Type"]&&n){u["Content-Type"]="application/x-www-form-urlencoded"}var p=new XMLHttpRequest();p.open(o[g.METHOD]||f.GET,m,true);for(var q in u){if(u.hasOwnProperty(q)){p.setRequestHeader(q,u[q])}}if(r){r=setTimeout(function(){p.abort()},r)}if(t.isMethodUnsafe(o[g.METHOD])){p.setRequestHeader(t.getXSRFRequestHeaderName(),t.getXSRFCookie())}p.onreadystatechange=function(){if(p.readyState==2){p._headersReceived=true}else{if(p.readyState==4){if(r){clearTimeout(r)}if(s){if(window.opera&&!p.status){p.status=204;p.statusText="No Content"}var v=new a(o[g.CONTENT_TYPE],p.responseText,p.status,p.statusText,p._headersReceived?String(p.getAllResponseHeaders()).split("\n"):[]);s(v)}}}};p.send(n);return p}this.encodeValues=c;this.getProxyUrl=h;this.makeRequest=i;this.RequestParameters=g;this.MethodType=f;this.ContentType=e;this.AuthorizationType=j;this.ProxyUrlRequestParameters=k});b$.module("gadgets.pubsub",function(){var f=b$._private.types.STRING;var i=b$._private.types.FUNCTION;var a=b$.Class;var d=a.extend(function(){this.callbacks=[]},{subscribe:function(j){this.callbacks.push(j)},unsubscribe:function(j){if(!j){this.callbacks=[]}else{this.callbacks=this.callbacks.filter(function(k){return k!=j})}},publish:function(j){this.callbacks.forEach(function(k){k(j)})}});var g=a.extend(function(){this.channels={}},{subscribe:function(j,k){if(!this.channels[j]){this.channels[j]=new d()}this.channels[j].subscribe(k)},unsubscribe:function(j,k){if(this.channels[j]){this.channels[j].unsubscribe(k)}},publish:function(j,k){if(this.channels[j]){this.channels[j].publish(k)}}});var e=new g();function b(j,k){e.publish(j,k)}function c(j,k){e.subscribe(j,k)}function h(j,k){e.unsubscribe(j,k)}this.publish=b;this.subscribe=c;this.unsubscribe=h});b$.module("gadgets.util",function(){var b=b$._private.uri.URI;var d={0:false,10:true,13:true,34:true,39:true,60:true,62:true,92:true,8232:true,8233:true};var e=f();function f(g){if(e&&g===undefined){return e}var i=new b(g||document.location.href),h={};(i.getQuery()||"").split("&").concat((i.getFragment()||"").split("&")).forEach(function(k){var j=k.split("=");if(j.length==2){h[j[0]]=decodeURIComponent(j[1].replace(/\+/g," "))}});return h}function a(g){return g&&g.replace(/[\s\S]/mg,function(h){var j=h.charCodeAt(0);var i=d[j];if(i===true){return"&#"+j+";"}else{if(i!==false){return h}}})}function c(g){return g&&g.replace(/&#([0-9]+);/g,function(h,i){return String.fromCharCode(i)})}this.getUrlParameters=f;this.escapeString=a;this.unescapeString=c});window.bp=window.bp||{};bp.api={};bp.api.getCurrentPortal=function(){return{name:b$.portal.portalName}};bp.api.getCurrentPage=function(){return{name:b$.portal.pageName}};